package com.mjk.common.core.jdbc.conf;


import com.mjk.common.tools.springextend.BeeApplicationListener;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.DependsOn;

@Configuration
@DependsOn(value = "beeSpringBean")
public class ShardingConfiguration implements BeeApplicationListener {
	// 每个分表注解保存在这里
	//private Map<Class,Object> map = new HashMap<Class,Object>();


	@Override
	public void doApplicationContext(ApplicationContext applicationContext) {
//		ShardingTableService shardingTableService =applicationContext.getBean(ShardingTableService.class);
//		Map<String, Object> map = applicationContext.getBeansWithAnnotation(ArcSharding.class);
//		map.putAll(applicationContext.getBeansWithAnnotation(ArcShardingProxy.class));
//		for(Entry<String,Object> entry : map.entrySet()) {
//			if(entry.getValue() instanceof BaseEntity){
				//如果沒有繼承BASEENTRY不自動建標	
				//Object o = AopTargetUtils.getTarget(entry.getValue());
				//shardingTableService.createModel((BaseEntity)o );
				//是否需要反向映射
				//shardingTableService.createTable((BaseEntity)o );
				//在建表的同时创建Example文件
				//ExampleUtil.buildExampleFile(o.getClass());
//			}
//		}
	}

}
